﻿namespace ten
{
    internal class Program
    {
        static void Main(string[] args)
        {
            
                int count = 0; // 计数器，用来数有多少个三位数

                Console.WriteLine("由1,2,3,4组成的互不相同且无重复数字的三位数有：");


                for (int hundred = 1; hundred <= 4; hundred++)
                {

                    for (int ten = 1; ten <= 4; ten++)
                    {

                        for (int one = 1; one <= 4; one++)
                        {

                            if (hundred != ten && hundred != one && ten != one)
                            {

                                int number = hundred * 100 + ten * 10 + one;
                                count++;

                                Console.Write(number + " ");


                                if (count % 10 == 0)
                                {
                                    Console.WriteLine();
                                }
                            }
                        }
                    }
                }
                Console.WriteLine("总共能组成 " + count + " 个互不相同且无重复数字的三位数");
            }
        }
    }

